$('.click').prop('isExpand', false).click(function () {
    let isExpand = $(this).prop('isExpand')
    if (!isExpand) {
        $(this).prop('isExpand', true).nextAll().slideDown(200)

    } else {
        $(this).prop('isExpand', false).nextAll().slideUp(200)
    }
})

let regExp = /^<[^<]+\s+src="([^''""]*)"/

let product = document.querySelector('#goods')



fetch('http://chst.vip:1234/api/getmoneyctrl')
    .then(body => body.json())
    .then(res => {
        console.log(res);
        let data = res.result
        
        let html = ""
        data.forEach(item => {
            let match = regExp.exec(item.productImg2)
            let imgSrc = (match[1].split(';')[1].split('=')[1])

            // console.log(imgSrc);

            // console.log(product);

            html += `
                <li productid="${item.productId}">
                <a href='pages/detail.html?productid=${item.productId}'}>
                <img src="${imgSrc}" style="width:2.6667rem" alt="">
                <div id="top">
                    <h4>
                        <b>${item.productName}</b>
                        <span>${item.productPinkage}</span>
                    </h4>
                </div>
                <div id="bottn">
                    <span>${item.productFrom} |</span>
                    <span>${item.productTime}</span>
                    <span id="ic">
                        <img src="./assets/imges/信息.png" width: .4rem></img>
                        <i>${item.productComCount}</i>
                    </apan>
                    
                    
                </div>
                </a>
               
                </li>   
             `
        })
        product.innerHTML = html
        
    }) 




   